#include <iostream>
#include <sys/ipc.h>
#include <sys/stat.h>
#include <cstring>
#include <cstdio>
#include <cerrno>
#include <unistd.h>
#include <cstdlib>
#define PATH_NAME "/home/hyr/linux_code/linux19"
#define PROJ_ID 0x16

key_t CreateKey()
{
    key_t key = ftok(PATH_NAME, PROJ_ID);
    if (key < 0)
    {
        std::cerr << "ftok:" << strerror(errno) << std::endl;
        exit(-1);
    }
    return key;
}

int main()
{
    std::cout << CreateKey() << std::endl;
    return 0;
}